package proguide.library;

import android.app.Dialog;
import android.os.AsyncTask;

public class background_task extends AsyncTask<Void, Void, Void>
{
	Dialog          d;
	async_methods	methods;

	public background_task( async_methods p_param, Dialog p_d )
	{
		methods = p_param;
		d = p_d;

	}

	public background_task( async_methods p_param )
	{
		methods = p_param;
	}

	protected void onPreExecute()
	{
		try
		{
			if ( d != null )
			{
				d.show( );
			}
		}
		catch ( Exception e )
		{
		}
	}

	protected void onPostExecute( Void p_param )
	{
		try
		{
			if ( d != null )
			{
				d.dismiss( );
			}
		}
		catch ( Exception e )
		{
		}
		methods.do_post_execute( );
	}

	@Override
	protected Void doInBackground( Void... params )
	{
		methods.do_background( );
		return null;
	}
}